import 'package:flutter/material.dart';
import 'package:hong_vpn_new_20240626/utils/Configs/color_config.dart';
import 'package:hong_vpn_new_20240626/utils/configs/text_style_config.dart';

class SettingCell extends StatefulWidget {
  final String title;

  final Function()? onTap;

  const SettingCell({super.key, required this.title, this.onTap});

  @override
  State<SettingCell> createState() => _SettingCellState();
}

class _SettingCellState extends State<SettingCell> {
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: widget.onTap,
      child: Container(
        color: ColorConfig.bg,
        margin: const EdgeInsets.only(left: 15, right: 15),
        height: 50,
        child: Column(
          children: [
            Expanded(
                child: Padding(
              padding: const EdgeInsets.only(left: 10),
              child: Row(
                children: [
                  Text(
                    widget.title,
                    style: TextStyleConfig.bold,
                  ),
                  const Spacer(),
                  const Icon(Icons.arrow_forward_ios_rounded)
                ],
              ),
            )),
            Divider(
              height: 0.5,
              thickness: 0,
              color: Colors.white.withOpacity(0.2),
            )
          ],
        ),
      ),
    );
  }
}
